package net.jlibrary.curbparking.action.vo;

import java.io.Serializable;
import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

import net.jlibrary.common.CoreConstants;
import net.jlibrary.common.core.annotation.VoForPo;
import net.jlibrary.common.core.entity.BaseVo;
import net.jlibrary.curbparking.domain.Device;
import net.jlibrary.curbparking.domain.DeviceStatus;
import net.jlibrary.group.domain.ParkingPlace;

@VoForPo(Device.class)
public class DeviceVo extends BaseVo {
	private static final long serialVersionUID = -3875856161403191642L;
	private Long id;
	private String code;// 设备编号
	private String name;
	private ParkingPlaceVo parkingPlace;
	private double longitude;// 经度
	private double latitude;// 维度
	private DeviceStatusVo status;// 设备状态
	@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
	@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
	private Date statusUpTime;
	@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
	@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
	private Date createdate;
	@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
	@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
	private Date lastdate;
	private String exceptionCause;// 异常原因

	public DeviceVo() {
		parkingPlace = new ParkingPlaceVo();
		status = new DeviceStatusVo();
	}

	public ParkingPlaceVo getParkingPlace() {
		return parkingPlace;
	}

	public void setParkingPlace(ParkingPlaceVo parkingPlace) {
		this.parkingPlace = parkingPlace;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public double getLongitude() {
		return longitude;
	}

	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}

	public double getLatitude() {
		return latitude;
	}

	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}

	public DeviceStatusVo getStatus() {
		return status;
	}

	public void setStatus(DeviceStatusVo status) {
		this.status = status;
	}

	public Date getStatusUpTime() {
		return statusUpTime;
	}

	public void setStatusUpTime(Date statusUpTime) {
		this.statusUpTime = statusUpTime;
	}

	public Date getCreatedate() {
		return createdate;
	}

	public void setCreatedate(Date createdate) {
		this.createdate = createdate;
	}

	public Date getLastdate() {
		return lastdate;
	}

	public void setLastdate(Date lastdate) {
		this.lastdate = lastdate;
	}

	public String getExceptionCause() {
		return exceptionCause;
	}

	public void setExceptionCause(String exceptionCause) {
		this.exceptionCause = exceptionCause;
	}

	@VoForPo(ParkingPlace.class)
	public class ParkingPlaceVo extends BaseVo {
		private static final long serialVersionUID = -9051354145997328794L;
		private Long id;
		private String address;
		private double longitude;
		private double latitude;
		private int totalFixedspaces;
		private String platePrefix;
		private String code;
		private String fullName;
		private String shortName;
		private boolean valid;
		private String loginMode;
		@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
		@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
		private Date createdate;
		@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
		@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
		private Date lastdate;

		public Long getId() {
			return id;
		}

		public void setId(Long id) {
			this.id = id;
		}

		public String getAddress() {
			return address;
		}

		public void setAddress(String address) {
			this.address = address;
		}

		public double getLongitude() {
			return longitude;
		}

		public void setLongitude(double longitude) {
			this.longitude = longitude;
		}

		public double getLatitude() {
			return latitude;
		}

		public void setLatitude(double latitude) {
			this.latitude = latitude;
		}

		public int getTotalFixedspaces() {
			return totalFixedspaces;
		}

		public void setTotalFixedspaces(int totalFixedspaces) {
			this.totalFixedspaces = totalFixedspaces;
		}

		public String getPlatePrefix() {
			return platePrefix;
		}

		public void setPlatePrefix(String platePrefix) {
			this.platePrefix = platePrefix;
		}

		public String getCode() {
			return code;
		}

		public void setCode(String code) {
			this.code = code;
		}

		public String getFullName() {
			return fullName;
		}

		public void setFullName(String fullName) {
			this.fullName = fullName;
		}

		public String getShortName() {
			return shortName;
		}

		public void setShortName(String shortName) {
			this.shortName = shortName;
		}

		public boolean isValid() {
			return valid;
		}

		public void setValid(boolean valid) {
			this.valid = valid;
		}

		public String getLoginMode() {
			return loginMode;
		}

		public void setLoginMode(String loginMode) {
			this.loginMode = loginMode;
		}

		@Override
		public Serializable getPrimaryKey() {
			// TODO Auto-generated method stub
			return id;
		}

		@Override
		public Serializable getText() {
			// TODO Auto-generated method stub
			return name;
		}

		public Date getCreatedate() {
			return createdate;
		}

		public void setCreatedate(Date createdate) {
			this.createdate = createdate;
		}

		public Date getLastdate() {
			return lastdate;
		}

		public void setLastdate(Date lastdate) {
			this.lastdate = lastdate;
		}

	}

	@VoForPo(DeviceStatus.class)
	public class DeviceStatusVo extends BaseVo {
		private static final long serialVersionUID = -1616200913601477125L;
		private Long id;
		private String name;
		private String code;
		private String description;
		private int taxis;
		private boolean valid;
		private boolean allowQueryInvalid;
		private boolean compellingDelete;
		private String parentIsNull;
		private String validString;
		@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
		@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
		private Date createdate;
		@DateTimeFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT)
		@JsonFormat(pattern = CoreConstants.DATETIME_FORMAT_DEFAULT, timezone = CoreConstants.DATE_TIMEZONE_DEFAULT)
		private Date lastdate;

		public Long getId() {
			return id;
		}

		@Override
		public Serializable getPrimaryKey() {
			return id;
		}

		@Override
		public Serializable getText() {
			return name;
		}

		public void setId(Long id) {
			this.id = id;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public String getCode() {
			return code;
		}

		public void setCode(String code) {
			this.code = code;
		}

		public String getDescription() {
			return description;
		}

		public void setDescription(String description) {
			this.description = description;
		}

		public int getTaxis() {
			return taxis;
		}

		public void setTaxis(int taxis) {
			this.taxis = taxis;
		}

		public boolean getValid() {
			return valid;
		}

		public void setValid(boolean valid) {
			this.valid = valid;
		}

		public boolean getAllowQueryInvalid() {
			return allowQueryInvalid;
		}

		public void setAllowQueryInvalid(boolean allowQueryInvalid) {
			this.allowQueryInvalid = allowQueryInvalid;
		}

		public boolean getCompellingDelete() {
			return compellingDelete;
		}

		public void setCompellingDelete(boolean compellingDelete) {
			this.compellingDelete = compellingDelete;
		}

		public String getParentIsNull() {
			return parentIsNull;
		}

		public void setParentIsNull(String parentIsNull) {
			this.parentIsNull = parentIsNull;
		}

		public String getValidString() {
			return validString;
		}

		public void setValidString(String validString) {
			this.validString = validString;
		}

		public Date getCreatedate() {
			return createdate;
		}

		public void setCreatedate(Date createdate) {
			this.createdate = createdate;
		}

		public Date getLastdate() {
			return lastdate;
		}

		public void setLastdate(Date lastdate) {
			this.lastdate = lastdate;
		}
	}

	@Override
	public Serializable getPrimaryKey() {
		// TODO Auto-generated method stub
		return id;
	}

	@Override
	public Serializable getText() {
		// TODO Auto-generated method stub
		return name;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

}
